package com.qf.day03.loop;

/**
 * 输出所有的水仙花数(各位数字立方之和等于数本身的三位整数)并输出
 */
public class NarcissisticNumber {
    public static void main(String[] args) {
        for (int i = 100; i <= 1000; i++) {
            int a = i;
            if (a == ((a % 10) * (a % 10) * (a % 10) + (a / 10 % 10) * (a / 10 % 10) * (a / 10 % 10) + (a / 100 % 10) * (a / 100 % 10) * (a / 100 % 10))) {
                System.out.println(a);
            }
        }
    }
}
